def writeFile():
    f=open("d:\\azmt.txt","wt")
    f.write("xba\nxyz")
    f.close()
def readFile():
    f=open("d:\\azmt.txt","rt")     #用只读方式打开D盘下的xba文本文档，并赋予变量f
    s=f.readline()
    print(s,"length=",len(s))
    s = f.readline()
    print(s, "length=", len(s))
    f.close()
try:
    writeFile()
    readFile()
except Ellipsis as err:
    print(err)